package com.zhang.consumer;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.function.Consumer;

/**
 * @Package: com.example.streamdemo.producer
 * @ClassName: FunctionProducer
 * @Author: Think
 * @CreateTime: 2021/7/17 9:11
 * @Description:
 */
@Slf4j
@Component
public class FunctionConsumer {

    @Bean
    public Consumer<Date> mySink(){
        return (message) -> {
            log.info("收到的消息为：{}", message);
        };
    }

}
